package com.study.zzedu.ui.choicecourse;

import android.content.Context;

import com.study.zzedu.base.BasePresenter;
import com.study.zzedu.base.BaseView;
import com.study.zzedu.http.OnResultListener;

public class ChoiceCoursePresenter extends BasePresenter<ChoiceCourseContract.IView> {

    private ChoiceCourseModel yoModel;
    public ChoiceCoursePresenter(){
        this.yoModel = new ChoiceCourseModel();
    }

    public void getSelectiveCourses(Context context){
        yoModel.getSelectiveCourses(context, new OnResultListener() {
            @Override
            public void onSuccess(String result) {
                getView().getData(result);
            }

            @Override
            public void onError(String error) {
                getView().showError(error);
            }
        });
    }

    public void submitData(Context context,String courseCodeList){
        yoModel.submitData(context, courseCodeList,new OnResultListener() {
            @Override
            public void onSuccess(String result) {
                getView().getSendBack(result);
            }

            @Override
            public void onError(String error) {
                getView().showError(error);
            }
        });
    }
}
